﻿<UserControl x:Class="Gallery.DragAndDrop.CanvasSample.CanvasSampleView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:local="clr-namespace:Gallery.DragAndDrop.CanvasSample"
             xmlns:apexMVVM="clr-namespace:Apex.MVVM;assembly=Apex"
             xmlns:apexControls="clr-namespace:Apex.Controls;assembly=Apex"
             xmlns:dragAndDrop="clr-namespace:Apex.DragAndDrop;assembly=Apex"
             mc:Ignorable="d" 
             d:DesignHeight="600" d:DesignWidth="800">


    <Grid Style="{StaticResource GalleryItemStyle}">

        <apexControls:PaddedGrid Rows="Auto,Auto,*,Auto" Padding="4">

            <!-- Title section. -->
            <TextBlock Grid.Row="0" Style="{StaticResource Heading1}">CANVAS SAMPLE</TextBlock>
            <TextBlock Grid.Row="1" Style="{StaticResource Subtitle}">
            In this sample, elements in a Canvas can be dragged and dropped.
            </TextBlock>

            <!-- Sample zone. -->
            <Grid Row="2" Margin="16" MaxWidth="600" MaxHeight="800">

                <dragAndDrop:DragAndDropHost x:Name="dragAndDropHost" Background="White">
                    <Canvas
            dragAndDrop:DragAndDrop.IsDragSource="True"
            dragAndDrop:DragAndDrop.IsDropTarget="True">
                        <Ellipse Width="50" Height="50" Fill="Red" Stroke="Black" StrokeThickness="2"
                     dragAndDrop:DragAndDrop.IsDraggable="True" />
                        <Ellipse Width="50" Height="50" Canvas.Left="100" Canvas.Top="60" Fill="Green" Stroke="Black" StrokeThickness="2"
                     dragAndDrop:DragAndDrop.IsDraggable="True" />

                        <Rectangle Width="100" Height="20" Canvas.Left="20" Canvas.Top="160" Fill="Yellow" Stroke="Black" StrokeThickness="2"
                     dragAndDrop:DragAndDrop.IsDraggable="True" />
                    </Canvas>
                </dragAndDrop:DragAndDropHost>
            </Grid>
        </apexControls:PaddedGrid>
    </Grid>
</UserControl>

            